#include "FoGGEDEF.h"
#include "GVContainer.h"
namespace _FOGGE_
{
	namespace _GDB_
	{

		GVContainer::GVContainer(void)
		{
		}

		GVContainer::~GVContainer(void)
		{
		}

		GV* GVContainer::FindGV(::_FO_UTIL::Name name) 
		{
			GVMapIter iter=m_GVMap.find(name);

			if(iter!=m_GVMap.end())
				return iter->second;
			else
				return NULL;
		}

		const GV* GVContainer::FindGV(::_FO_UTIL::Name name)const 
		{
			std::map<::_FO_UTIL::Name,GV*>::const_iterator iter=m_GVMap.find(name);

			if(iter!=m_GVMap.end())
				return iter->second;
			else
				return NULL;
		}


		void GVContainer::Add(GV* ptrGV)
		{
			assert(ptrGV&&__T("GVContainer::Add_ ptrGV is NULL!!! "));

#ifdef _DEBUG
			GVMapIter iter=m_GVMap.find(ptrGV->GetName());

			if(iter!=m_GVMap.end())
				assert(ptrGV&&__T("GVContainer::Add_ already inserted!!! "));
#endif
			m_GVMap[ptrGV->GetName()]=ptrGV;
		}

	}
}